<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
               "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
lang="zh-CN" xml:lang="zh-CN">
<head>
<title>Emacs 学习记录</title>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<meta name="generator" content="Org-mode"/>
<meta name="generated" content="<2011-01-07>"/>
<meta name="author" content="Wang Wanqing"/>
<style type="text/css">
 <!--/*--><![CDATA[/*><!--*/
  html { font-family: Times, serif; font-size: 12pt; }
  .title  { text-align: center; }
  .todo   { color: red; }
  .done   { color: green; }
  .tag    { background-color:lightblue; font-weight:normal }
  .target { }
  .timestamp { color: grey }
  .timestamp-kwd { color: CadetBlue }
  p.verse { margin-left: 3% }
  pre {
	border: 1pt solid #AEBDCC;
	background-color: #F3F5F7;
	padding: 5pt;
	font-family: courier, monospace;
        font-size: 90%;
        overflow:auto;
  }
  table { border-collapse: collapse; }
  td, th { vertical-align: top; }
  dt { font-weight: bold; }
  div.figure { padding: 0.5em; }
  div.figure p { text-align: center; }
  .linenr { font-size:smaller }
  .code-highlighted {background-color:#ffff00;}
  .org-info-js_info-navigation { border-style:none; }
  #org-info-js_console-label { font-size:10px; font-weight:bold;
                               white-space:nowrap; }
  .org-info-js_search-highlight {background-color:#ffff00; color:#000000;
                                 font-weight:bold; }
  /*]]>*/-->
</style><link rel="stylesheet" href="./css/emacs.css" type="text/css"/>
<link rel="stylesheet" type="text/css" href="../css/org.css">
<script type="text/javascript">
<!--/*--><![CDATA[/*><!--*/
 function CodeHighlightOn(elem, id)
 {
   var target = document.getElementById(id);
   if(null != target) {
     elem.cacheClassElem = elem.className;
     elem.cacheClassTarget = target.className;
     target.className = "code-highlighted";
     elem.className   = "code-highlighted";
   }
 }
 function CodeHighlightOff(elem, id)
 {
   var target = document.getElementById(id);
   if(elem.cacheClassElem)
     elem.className = elem.cacheClassElem;
   if(elem.cacheClassTarget)
     target.className = elem.cacheClassTarget;
 }
/*]]>*/-->
</script>
</head><body>
<h1 class="title">Emacs 学习记录</h1>




<div id="table-of-contents">
<h2>Table of Contents</h2>
<div id="text-table-of-contents">
<ul>
<li><a href="#sec-1">1 我的设置 </a>
<ul>
<li>
<ul>
<li><a href="#sec-1.1">1.1 Emacs 配置第一版 </a></li>
<li><a href="#sec-1.2">1.2 配置第二版 //wyatt@2010/11/28 09:43:09 </a></li>
</ul></li>
</ul>
</li>
<li><a href="#sec-2">2 常用功能 </a></li>
<li><a href="#sec-3">3 常用插件 </a></li>
</ul>
</div>
</div>

<div id="outline-container-1" class="outline-2">
<h2 id="sec-1">1 我的设置 </h2>
<div id="text-1">


</div>

<div id="outline-container-1.1" class="outline-4">
<h4 id="sec-1.1">1.1 Emacs 配置第一版 </h4>
<div id="text-1.1">





<pre class="src src-lisp">
<span style="color: #ffd700;">;;</span><span style="color: #ffd700;">LOAD_PATH
</span><span style="color: #ffd700;">;;</span><span style="color: #ffd700;">(add-to-list 'load-path' "~/.emacs.d/site-lisp")
</span>
(custom-set-variables
  <span style="color: #ffd700;">;; </span><span style="color: #ffd700;">custom-set-variables was added by Custom.
</span>  <span style="color: #ffd700;">;; </span><span style="color: #ffd700;">If you edit it by hand, you could mess it up, so be careful.
</span>  <span style="color: #ffd700;">;; </span><span style="color: #ffd700;">Your init file should contain only one such instance.
</span>  <span style="color: #ffd700;">;; </span><span style="color: #ffd700;">If there is more than one, they won't work right.
</span> '(scroll-bar-mode (quote right)))
(custom-set-faces
  <span style="color: #ffd700;">;; </span><span style="color: #ffd700;">custom-set-faces was added by Custom.
</span>  <span style="color: #ffd700;">;; </span><span style="color: #ffd700;">If you edit it by hand, you could mess it up, so be careful.
</span>  <span style="color: #ffd700;">;; </span><span style="color: #ffd700;">Your init file should contain only one such instance.
</span>  <span style="color: #ffd700;">;; </span><span style="color: #ffd700;">If there is more than one, they won't work right.
</span> '(default ((t (<span style="color: #00ffff; font-weight: bold;">:inherit</span> nil <span style="color: #00ffff; font-weight: bold;">:stipple</span> nil <span style="color: #00ffff; font-weight: bold;">:background</span> <span style="color: #f0e68c;">"white"</span> <span style="color: #00ffff; font-weight: bold;">:foreground</span> <span style="color: #f0e68c;">"black"</span> <span style="color: #00ffff; font-weight: bold;">:inverse-video</span> nil <span style="color: #00ffff; font-weight: bold;">:box</span> nil <span style="color: #00ffff; font-weight: bold;">:strike-through</span> nil <span style="color: #00ffff; font-weight: bold;">:overline</span> nil <span style="color: #00ffff; font-weight: bold;">:underline</span> nil <span style="color: #00ffff; font-weight: bold;">:slant</span> normal <span style="color: #00ffff; font-weight: bold;">:weight</span> normal <span style="color: #00ffff; font-weight: bold;">:height</span> 143 <span style="color: #00ffff; font-weight: bold;">:width</span> normal <span style="color: #00ffff; font-weight: bold;">:foundry</span> <span style="color: #f0e68c;">"apple"</span> <span style="color: #00ffff; font-weight: bold;">:family</span> <span style="color: #f0e68c;">"Monaco"</span>))))
 '(pp^L-highlight ((((type x w32 mac graphic) (class color)) (<span style="color: #00ffff; font-weight: bold;">:box</span> (<span style="color: #00ffff; font-weight: bold;">:line-width</span> 3 <span style="color: #00ffff; font-weight: bold;">:style</span> pressed-button))))))

<span style="color: #ffd700;">;;;;</span><span style="color: #ffd700;">&#26174;&#31034;&#34892;&#21495;
</span>(global-linum-mode t)

<span style="color: #ffd700;">;;</span><span style="color: #ffd700;">&#39068;&#33394;
</span><span style="color: #ffd700;">;;</span><span style="color: #ffd700;">(load-file "~/.emacs.d/site-lisp/color-theme.el")
</span><span style="color: #ffd700;">;;</span><span style="color: #ffd700;">(setq load-path (cons "~/.emacs.d/site-lisp/" load-path))
</span><span style="color: #ffd700;">;;</span><span style="color: #ffd700;">(require 'color-theme)
</span><span style="color: #ffd700;">;;</span><span style="color: #ffd700;">(color-theme-initialize)
</span><span style="color: #ffd700;">;;</span><span style="color: #ffd700;">(color-theme-bharadwaj-slate)
</span><span style="color: #ffd700;">;;</span><span style="color: #ffd700;">(color-theme-gray30)
</span><span style="color: #ffd700;">;;</span><span style="color: #ffd700;">(color-theme-dark-blue2)
</span><span style="color: #ffd700;">;;</span><span style="color: #ffd700;">(color-theme-robin-hood)
</span><span style="color: #ffd700;">;;</span><span style="color: #ffd700;">(color-theme-sitaram-nt)
</span><span style="color: #ffd700;">;;</span><span style="color: #ffd700;">(color-theme-calm-forest)
</span>
<span style="color: #ffd700;">;;</span><span style="color: #ffd700;">&#33258;&#21160;&#25442;&#34892;
</span><span style="color: #ffd700;">;;</span><span style="color: #ffd700;">(setq load-path (cons "~/.emacs.d/site-lisp/" load-path))
</span>
(setq auto-mode-alist
 (cons '(<span style="color: #f0e68c;">"\\.py$"</span> . python-mode) auto-mode-alist))

(setq interpreter-mode-alist
 (cons '(<span style="color: #f0e68c;">"python"</span> . python-mode)
 interpreter-mode-alist))

(autoload 'python-mode <span style="color: #f0e68c;">"python-mode"</span> <span style="color: #f0e68c;">"Python editing mode."</span> t)
<span style="color: #ffd700;">;;; </span><span style="color: #ffd700;">add these lines if you like color-based syntax highlighting
</span>(global-font-lock-mode t)
(setq font-lock-maximum-decoration t)

(autoload 'pymacs-apply <span style="color: #f0e68c;">"pymacs"</span>)
(autoload 'pymacs-call <span style="color: #f0e68c;">"pymacs"</span>)
(autoload 'pymacs-eval <span style="color: #f0e68c;">"pymacs"</span> nil t)
(autoload 'pymacs-exec <span style="color: #f0e68c;">"pymacs"</span> nil t)
(autoload 'pymacs-load <span style="color: #f0e68c;">"pymacs"</span> nil t)

<span style="color: #ffd700;">;;</span><span style="color: #ffd700;">&#33258;&#21160;&#34917;&#20840;
</span>(autoload 'python-mode <span style="color: #f0e68c;">"python-mode"</span> <span style="color: #f0e68c;">"Python Mode."</span> t)
(add-to-list 'auto-mode-alist '(<span style="color: #f0e68c;">"\\.py\\'"</span> . python-mode))
(add-to-list 'interpreter-mode-alist '(<span style="color: #f0e68c;">"python"</span> . python-mode))

(<span style="color: #00ffff; font-weight: bold;">require</span> '<span style="color: #b0c4de; font-weight: bold;">pycomplete</span>)

<span style="color: #ffd700;">;;</span><span style="color: #ffd700;">set ipython as the shell
</span>(setq ipython-command <span style="color: #f0e68c;">"/usr/bin/ipython"</span>)
(<span style="color: #00ffff; font-weight: bold;">require</span> '<span style="color: #b0c4de; font-weight: bold;">ipython</span>)

<span style="color: #ffd700;">;; </span><span style="color: #ffd700;">&#21551;&#21160;&#31383;&#21475;&#22823;&#23567;
</span>(setq default-frame-alist
      '((height . 40) (width . 70) (menu-bar-lines . 20) (tool-bar-lines . 0))) 
<span style="color: #ffd700;">;;</span><span style="color: #ffd700;">org&#35774;&#32622;
</span>(<span style="color: #00ffff; font-weight: bold;">require</span> '<span style="color: #b0c4de; font-weight: bold;">org-install</span>)
(<span style="color: #00ffff; font-weight: bold;">require</span> '<span style="color: #b0c4de; font-weight: bold;">org-publish</span>)
(add-to-list 'auto-mode-alist '(<span style="color: #f0e68c;">"\\.org\\'"</span> . org-mode))
(add-hook 'org-mode-hook 'turn-on-font-lock)
(add-hook 'org-mode-hook 
(<span style="color: #00ffff; font-weight: bold;">lambda</span> () (setq truncate-lines nil)))
 
(global-set-key <span style="color: #f0e68c;">"\C-cl"</span> 'org-store-link)
(global-set-key <span style="color: #f0e68c;">"\C-ca"</span> 'org-agenda)
(global-set-key <span style="color: #f0e68c;">"\C-cb"</span> 'org-iswitchb)

<span style="color: #ffd700;">;;</span><span style="color: #ffd700;">&#20445;&#23384;&#30446;&#24405;&#21450;&#21457;&#24067;&#30446;&#24405;
</span>(setq org-publish-project-alist
      '((<span style="color: #f0e68c;">"note-org"</span>
         <span style="color: #00ffff; font-weight: bold;">:base-directory</span> <span style="color: #f0e68c;">"/home/wyatt/wlife/trunk/org"</span>
         <span style="color: #00ffff; font-weight: bold;">:publishing-directory</span> <span style="color: #f0e68c;">"/home/wyatt/wlife/trunk/note"</span>
         <span style="color: #00ffff; font-weight: bold;">:base-extension</span> <span style="color: #f0e68c;">"org"</span>
         <span style="color: #00ffff; font-weight: bold;">:recursive</span> t
         <span style="color: #00ffff; font-weight: bold;">:publishing-function</span> org-publish-org-to-html
         <span style="color: #00ffff; font-weight: bold;">:auto-index</span> t
         <span style="color: #00ffff; font-weight: bold;">:index-filename</span> <span style="color: #f0e68c;">"index.org"</span>
         <span style="color: #00ffff; font-weight: bold;">:index-title</span> <span style="color: #f0e68c;">"index"</span>
         <span style="color: #00ffff; font-weight: bold;">:link-home</span> <span style="color: #f0e68c;">"index.html"</span>
         <span style="color: #00ffff; font-weight: bold;">:section-numbers</span> t
         <span style="color: #00ffff; font-weight: bold;">:style</span> <span style="color: #f0e68c;">"&lt;link rel=\"stylesheet\" href=\"./css/emacs.css\" type=\"text/css\"/&gt;"</span>
         )

        (<span style="color: #f0e68c;">"note-static"</span>
         <span style="color: #00ffff; font-weight: bold;">:base-directory</span> <span style="color: #f0e68c;">"/home/wyatt/wlife/trunk/org"</span>
         <span style="color: #00ffff; font-weight: bold;">:publishing-directory</span> <span style="color: #f0e68c;">"/home/wyatt/wlife/trunk/note"</span>
         <span style="color: #00ffff; font-weight: bold;">:recursive</span> t
         <span style="color: #00ffff; font-weight: bold;">:base-extension</span> <span style="color: #f0e68c;">"css</span><span style="color: #f5deb3; font-weight: bold;">\\</span><span style="color: #f5deb3; font-weight: bold;">|</span><span style="color: #f0e68c;">js</span><span style="color: #f5deb3; font-weight: bold;">\\</span><span style="color: #f5deb3; font-weight: bold;">|</span><span style="color: #f0e68c;">png</span><span style="color: #f5deb3; font-weight: bold;">\\</span><span style="color: #f5deb3; font-weight: bold;">|</span><span style="color: #f0e68c;">jpg</span><span style="color: #f5deb3; font-weight: bold;">\\</span><span style="color: #f5deb3; font-weight: bold;">|</span><span style="color: #f0e68c;">gif</span><span style="color: #f5deb3; font-weight: bold;">\\</span><span style="color: #f5deb3; font-weight: bold;">|</span><span style="color: #f0e68c;">pdf</span><span style="color: #f5deb3; font-weight: bold;">\\</span><span style="color: #f5deb3; font-weight: bold;">|</span><span style="color: #f0e68c;">mp3</span><span style="color: #f5deb3; font-weight: bold;">\\</span><span style="color: #f5deb3; font-weight: bold;">|</span><span style="color: #f0e68c;">swf</span><span style="color: #f5deb3; font-weight: bold;">\\</span><span style="color: #f5deb3; font-weight: bold;">|</span><span style="color: #f0e68c;">zip</span><span style="color: #f5deb3; font-weight: bold;">\\</span><span style="color: #f5deb3; font-weight: bold;">|</span><span style="color: #f0e68c;">gz</span><span style="color: #f5deb3; font-weight: bold;">\\</span><span style="color: #f5deb3; font-weight: bold;">|</span><span style="color: #f0e68c;">txt</span><span style="color: #f5deb3; font-weight: bold;">\\</span><span style="color: #f5deb3; font-weight: bold;">|</span><span style="color: #f0e68c;">el"</span>
         <span style="color: #00ffff; font-weight: bold;">:publishing-function</span> org-publish-attachment)
        (<span style="color: #f0e68c;">"note"</span> 
         <span style="color: #00ffff; font-weight: bold;">:components</span> (<span style="color: #f0e68c;">"note-org"</span> <span style="color: #f0e68c;">"note-static"</span>)
         <span style="color: #00ffff; font-weight: bold;">:author</span> <span style="color: #f0e68c;">"wwq0327@gmail.com"</span>
         )))

<span style="color: #ffd700;">;;</span><span style="color: #ffd700;">&#24555;&#25463;&#38190;
</span>
(global-set-key (kbd <span style="color: #f0e68c;">"&lt;f8&gt; p"</span>) 'org-publish)

<span style="color: #ffd700;">;;</span><span style="color: #ffd700;">&#20026;&#20102;&#22312;org mode&#20013;&#20351;&#29992;auto-complete&#65292;&#25105;&#22312;auto-complete&#20013;&#22686;&#21152;&#20102;&#36825;&#26679;&#30340;&#37197;&#32622;&#65306;
</span><span style="color: #ffd700;">;;</span><span style="color: #ffd700;">(setq ac-modes
</span><span style="color: #ffd700;">;;      </span><span style="color: #ffd700;">(append ac-modes '(org-mode objc-mode jde-mode sql-mode
</span><span style="color: #ffd700;">;;                                  </span><span style="color: #ffd700;">change-log-mode text-mode
</span><span style="color: #ffd700;">;;                                  </span><span style="color: #ffd700;">makefile-gmake-mode makefile-bsdmake-mo
</span><span style="color: #ffd700;">;;                                  </span><span style="color: #ffd700;">autoconf-mode makefile-automake-mode)))
</span>
<span style="color: #ffd700;">;;</span><span style="color: #ffd700;">&#25554;&#20837;&#24403;&#21069;&#26102;&#38388;
</span>
(<span style="color: #00ffff; font-weight: bold;">defun</span> <span style="color: #ffff00; font-weight: bold;">my-insert-date</span> ()
    (interactive)
    (insert <span style="color: #f0e68c;">"//"</span>)
    (insert (user-full-name))
    (insert <span style="color: #f0e68c;">"@"</span>)
    (insert (format-time-string <span style="color: #f0e68c;">"%Y/%m/%d %H:%M:%S"</span> (current-time))))
(global-set-key (kbd <span style="color: #f0e68c;">"&lt;f9&gt;"</span>) 'my-insert-date)

</pre>





<pre class="src src-python">
<span style="color: #ffd700;">#</span><span style="color: #ffd700;">coding:utf-8
</span><span style="color: #00ffff; font-weight: bold;">def</span> <span style="color: #ffff00; font-weight: bold;">a</span>():
  <span style="color: #00ffff; font-weight: bold;">print</span> <span style="color: #f0e68c;">'hello, world'</span>
</pre>




</div>

</div>

<div id="outline-container-1.2" class="outline-4">
<h4 id="sec-1.2">1.2 配置第二版 //wyatt@2010/11/28 09:43:09 </h4>
<div id="text-1.2">





<pre class="src src-lisp">
<span style="color: #ffd700;">;;</span><span style="color: #ffd700;">LOAD_PATH
</span><span style="color: #ffd700;">;;</span><span style="color: #ffd700;">(add-to-list 'load-path' "~/.emacs.d/site-lisp")
</span>
(custom-set-variables
  <span style="color: #ffd700;">;; </span><span style="color: #ffd700;">custom-set-variables was added by Custom.
</span>  <span style="color: #ffd700;">;; </span><span style="color: #ffd700;">If you edit it by hand, you could mess it up, so be careful.
</span>  <span style="color: #ffd700;">;; </span><span style="color: #ffd700;">Your init file should contain only one such instance.
</span>  <span style="color: #ffd700;">;; </span><span style="color: #ffd700;">If there is more than one, they won't work right.
</span> '(scroll-bar-mode (quote right))
 '(tab-always-indent t))
(custom-set-faces
  <span style="color: #ffd700;">;; </span><span style="color: #ffd700;">custom-set-faces was added by Custom.
</span>  <span style="color: #ffd700;">;; </span><span style="color: #ffd700;">If you edit it by hand, you could mess it up, so be careful.
</span>  <span style="color: #ffd700;">;; </span><span style="color: #ffd700;">Your init file should contain only one such instance.
</span>  <span style="color: #ffd700;">;; </span><span style="color: #ffd700;">If there is more than one, they won't work right.
</span> '(default ((t (<span style="color: #00ffff; font-weight: bold;">:inherit</span> nil <span style="color: #00ffff; font-weight: bold;">:stipple</span> nil <span style="color: #00ffff; font-weight: bold;">:background</span> <span style="color: #f0e68c;">"white"</span> <span style="color: #00ffff; font-weight: bold;">:foreground</span> <span style="color: #f0e68c;">"black"</span> <span style="color: #00ffff; font-weight: bold;">:inverse-video</span> nil <span style="color: #00ffff; font-weight: bold;">:box</span> nil <span style="color: #00ffff; font-weight: bold;">:strike-through</span> nil <span style="color: #00ffff; font-weight: bold;">:overline</span> nil <span style="color: #00ffff; font-weight: bold;">:underline</span> nil <span style="color: #00ffff; font-weight: bold;">:slant</span> normal <span style="color: #00ffff; font-weight: bold;">:weight</span> normal <span style="color: #00ffff; font-weight: bold;">:height</span> 143 <span style="color: #00ffff; font-weight: bold;">:width</span> normal <span style="color: #00ffff; font-weight: bold;">:foundry</span> <span style="color: #f0e68c;">"apple"</span> <span style="color: #00ffff; font-weight: bold;">:family</span> <span style="color: #f0e68c;">"Monaco"</span>))))
 '(pp^L-highlight ((((type x w32 mac graphic) (class color)) (<span style="color: #00ffff; font-weight: bold;">:box</span> (<span style="color: #00ffff; font-weight: bold;">:line-width</span> 3 <span style="color: #00ffff; font-weight: bold;">:style</span> pressed-button))))))

<span style="color: #ffd700;">;;;;</span><span style="color: #ffd700;">&#26174;&#31034;&#34892;&#21495;
</span>(global-linum-mode t)

(<span style="color: #00ffff; font-weight: bold;">require</span> '<span style="color: #b0c4de; font-weight: bold;">session</span>)
(add-hook 'after-init-hook 'session-initialize)

<span style="color: #ffd700;">;;</span><span style="color: #ffd700;">&#39068;&#33394;
</span><span style="color: #ffd700;">;;</span><span style="color: #ffd700;">(load-file "~/.emacs.d/site-lisp/color-theme.el")
</span><span style="color: #ffd700;">;;</span><span style="color: #ffd700;">(setq load-path (cons "~/.emacs.d/site-lisp/" load-path))
</span><span style="color: #ffd700;">;;</span><span style="color: #ffd700;">(require 'color-theme)
</span><span style="color: #ffd700;">;;</span><span style="color: #ffd700;">(color-theme-initialize)
</span><span style="color: #ffd700;">;;</span><span style="color: #ffd700;">(color-theme-bharadwaj-slate)
</span><span style="color: #ffd700;">;;</span><span style="color: #ffd700;">(color-theme-gray30)
</span><span style="color: #ffd700;">;;</span><span style="color: #ffd700;">(color-theme-dark-blue2)
</span><span style="color: #ffd700;">;;</span><span style="color: #ffd700;">(color-theme-robin-hood)
</span><span style="color: #ffd700;">;;</span><span style="color: #ffd700;">(color-theme-sitaram-nt)
</span><span style="color: #ffd700;">;;</span><span style="color: #ffd700;">(color-theme-calm-forest)
</span>
<span style="color: #ffd700;">;;</span><span style="color: #ffd700;">python-mode &#33258;&#21160;&#32553;&#36827;&#21450;&#39640;&#20142;
</span>(setq auto-mode-alist
 (cons '(<span style="color: #f0e68c;">"\\.py$"</span> . python-mode) auto-mode-alist))

(setq interpreter-mode-alist
 (cons '(<span style="color: #f0e68c;">"python"</span> . python-mode)
 interpreter-mode-alist))

(autoload 'python-mode <span style="color: #f0e68c;">"python-mode"</span> <span style="color: #f0e68c;">"Python editing mode."</span> t)
<span style="color: #ffd700;">;;; </span><span style="color: #ffd700;">add these lines if you like color-based syntax highlighting
</span>(global-font-lock-mode t)
(setq font-lock-maximum-decoration t)

<span style="color: #ffd700;">;;</span><span style="color: #ffd700;">&#33258;&#21160;&#34917;&#20840;
</span>(<span style="color: #00ffff; font-weight: bold;">require</span> '<span style="color: #b0c4de; font-weight: bold;">pycomplete</span>)
(setq auto-mode-alist (cons '(<span style="color: #f0e68c;">"\\.py$"</span> . python-mode) auto-mode-alist))
(autoload 'python-mode <span style="color: #f0e68c;">"python-mode"</span> <span style="color: #f0e68c;">"Python editing mode."</span> t)
(autoload 'pymacs-load <span style="color: #f0e68c;">"pymacs"</span> nil t)
(autoload 'pymacs-eval <span style="color: #f0e68c;">"pymacs"</span> nil t)
(autoload 'pymacs-apply <span style="color: #f0e68c;">"pymacs"</span>)
(autoload 'pymacs-call <span style="color: #f0e68c;">"pymacs"</span>)

(setq interpreter-mode-alist(cons '(<span style="color: #f0e68c;">"python"</span> . python-mode)
                             interpreter-mode-alist)) 

<span style="color: #ffd700;">;;</span><span style="color: #ffd700;">set ipython as the shell
</span>(setq ipython-command <span style="color: #f0e68c;">"/usr/bin/ipython"</span>)
(<span style="color: #00ffff; font-weight: bold;">require</span> '<span style="color: #b0c4de; font-weight: bold;">ipython</span>)

<span style="color: #ffd700;">;;</span><span style="color: #ffd700;">define some keys
</span>(<span style="color: #00ffff; font-weight: bold;">require</span> '<span style="color: #b0c4de; font-weight: bold;">comint</span>)
(define-key comint-mode-map [(meta p)]
  'comint-previous-matching-input-from-input)
(define-key comint-mode-map [(meta n)]
  'comint-next-matching-input-from-input)
(define-key comint-mode-map [up]
  'comint-next-input)
(define-key comint-mode-map [down]
  'comint-previous-input)

<span style="color: #ffd700;">;; </span><span style="color: #ffd700;">&#21551;&#21160;&#31383;&#21475;&#22823;&#23567;
</span>(setq default-frame-alist
      '((height . 38) (width . 80) (menu-bar-lines . 20) (tool-bar-lines . 0))) 

<span style="color: #ffd700;">;;</span><span style="color: #ffd700;">org&#35774;&#32622;
</span>(<span style="color: #00ffff; font-weight: bold;">require</span> '<span style="color: #b0c4de; font-weight: bold;">org-install</span>)
(<span style="color: #00ffff; font-weight: bold;">require</span> '<span style="color: #b0c4de; font-weight: bold;">org-publish</span>)
(add-to-list 'auto-mode-alist '(<span style="color: #f0e68c;">"\\.org\\'"</span> . org-mode))
(add-hook 'org-mode-hook 'turn-on-font-lock)
(add-hook 'org-mode-hook 
(<span style="color: #00ffff; font-weight: bold;">lambda</span> () (setq truncate-lines nil)))
 
(global-set-key <span style="color: #f0e68c;">"\C-cl"</span> 'org-store-link)
(global-set-key <span style="color: #f0e68c;">"\C-ca"</span> 'org-agenda)
(global-set-key <span style="color: #f0e68c;">"\C-cb"</span> 'org-iswitchb)

<span style="color: #ffd700;">;;</span><span style="color: #ffd700;">&#20445;&#23384;&#30446;&#24405;&#21450;&#21457;&#24067;&#30446;&#24405;
</span>(setq org-publish-project-alist
      '((<span style="color: #f0e68c;">"note-org"</span>
         <span style="color: #00ffff; font-weight: bold;">:base-directory</span> <span style="color: #f0e68c;">"/home/wyatt/wlife/trunk/org"</span>
         <span style="color: #00ffff; font-weight: bold;">:publishing-directory</span> <span style="color: #f0e68c;">"/home/wyatt/wlife/trunk/note"</span>
         <span style="color: #00ffff; font-weight: bold;">:base-extension</span> <span style="color: #f0e68c;">"org"</span>
         <span style="color: #00ffff; font-weight: bold;">:recursive</span> t
         <span style="color: #00ffff; font-weight: bold;">:publishing-function</span> org-publish-org-to-html
         <span style="color: #00ffff; font-weight: bold;">:auto-index</span> t
         <span style="color: #00ffff; font-weight: bold;">:index-filename</span> <span style="color: #f0e68c;">"index.org"</span>
         <span style="color: #00ffff; font-weight: bold;">:index-title</span> <span style="color: #f0e68c;">"index"</span>
         <span style="color: #00ffff; font-weight: bold;">:link-home</span> <span style="color: #f0e68c;">"index.html"</span>
         <span style="color: #00ffff; font-weight: bold;">:section-numbers</span> t
         <span style="color: #00ffff; font-weight: bold;">:style</span> <span style="color: #f0e68c;">"&lt;link rel=\"stylesheet\" href=\"./css/emacs.css\" type=\"text/css\"/&gt;"</span>
         )

        (<span style="color: #f0e68c;">"note-static"</span>
         <span style="color: #00ffff; font-weight: bold;">:base-directory</span> <span style="color: #f0e68c;">"/home/wyatt/wlife/trunk/org"</span>
         <span style="color: #00ffff; font-weight: bold;">:publishing-directory</span> <span style="color: #f0e68c;">"/home/wyatt/wlife/trunk/note"</span>
         <span style="color: #00ffff; font-weight: bold;">:recursive</span> t
         <span style="color: #00ffff; font-weight: bold;">:base-extension</span> <span style="color: #f0e68c;">"css</span><span style="color: #f5deb3; font-weight: bold;">\\</span><span style="color: #f5deb3; font-weight: bold;">|</span><span style="color: #f0e68c;">js</span><span style="color: #f5deb3; font-weight: bold;">\\</span><span style="color: #f5deb3; font-weight: bold;">|</span><span style="color: #f0e68c;">png</span><span style="color: #f5deb3; font-weight: bold;">\\</span><span style="color: #f5deb3; font-weight: bold;">|</span><span style="color: #f0e68c;">jpg</span><span style="color: #f5deb3; font-weight: bold;">\\</span><span style="color: #f5deb3; font-weight: bold;">|</span><span style="color: #f0e68c;">gif</span><span style="color: #f5deb3; font-weight: bold;">\\</span><span style="color: #f5deb3; font-weight: bold;">|</span><span style="color: #f0e68c;">pdf</span><span style="color: #f5deb3; font-weight: bold;">\\</span><span style="color: #f5deb3; font-weight: bold;">|</span><span style="color: #f0e68c;">mp3</span><span style="color: #f5deb3; font-weight: bold;">\\</span><span style="color: #f5deb3; font-weight: bold;">|</span><span style="color: #f0e68c;">swf</span><span style="color: #f5deb3; font-weight: bold;">\\</span><span style="color: #f5deb3; font-weight: bold;">|</span><span style="color: #f0e68c;">zip</span><span style="color: #f5deb3; font-weight: bold;">\\</span><span style="color: #f5deb3; font-weight: bold;">|</span><span style="color: #f0e68c;">gz</span><span style="color: #f5deb3; font-weight: bold;">\\</span><span style="color: #f5deb3; font-weight: bold;">|</span><span style="color: #f0e68c;">txt</span><span style="color: #f5deb3; font-weight: bold;">\\</span><span style="color: #f5deb3; font-weight: bold;">|</span><span style="color: #f0e68c;">el"</span>
         <span style="color: #00ffff; font-weight: bold;">:publishing-function</span> org-publish-attachment)
        (<span style="color: #f0e68c;">"note"</span> 
         <span style="color: #00ffff; font-weight: bold;">:components</span> (<span style="color: #f0e68c;">"note-org"</span> <span style="color: #f0e68c;">"note-static"</span>)
         <span style="color: #00ffff; font-weight: bold;">:author</span> <span style="color: #f0e68c;">"wwq0327@gmail.com"</span>
         )))

<span style="color: #ffd700;">;;</span><span style="color: #ffd700;">&#24555;&#25463;&#38190;
</span>
(global-set-key (kbd <span style="color: #f0e68c;">"&lt;f8&gt; p"</span>) 'org-publish)

<span style="color: #ffd700;">;;</span><span style="color: #ffd700;">&#20026;&#20102;&#22312;org mode&#20013;&#20351;&#29992;auto-complete&#65292;&#25105;&#22312;auto-complete&#20013;&#22686;&#21152;&#20102;&#36825;&#26679;&#30340;&#37197;&#32622;&#65306;
</span><span style="color: #ffd700;">;;</span><span style="color: #ffd700;">(setq ac-modes
</span><span style="color: #ffd700;">;;      </span><span style="color: #ffd700;">(append ac-modes '(org-mode objc-mode jde-mode sql-mode
</span><span style="color: #ffd700;">;;                                  </span><span style="color: #ffd700;">change-log-mode text-mode
</span><span style="color: #ffd700;">;;                                  </span><span style="color: #ffd700;">makefile-gmake-mode makefile-bsdmake-mo
</span><span style="color: #ffd700;">;;                                  </span><span style="color: #ffd700;">autoconf-mode makefile-automake-mode)))
</span>
<span style="color: #ffd700;">;;</span><span style="color: #ffd700;">&#25554;&#20837;&#24403;&#21069;&#26102;&#38388;
</span>
(<span style="color: #00ffff; font-weight: bold;">defun</span> <span style="color: #ffff00; font-weight: bold;">my-insert-date</span> ()
    (interactive)
    (insert <span style="color: #f0e68c;">"//"</span>)
    (insert (user-full-name))
    (insert <span style="color: #f0e68c;">"@"</span>)
    (insert (format-time-string <span style="color: #f0e68c;">"%Y/%m/%d %H:%M:%S"</span> (current-time))))
(global-set-key (kbd <span style="color: #f0e68c;">"&lt;f9&gt;"</span>) 'my-insert-date)

<span style="color: #ffd700;">;;</span><span style="color: #ffd700;">tab&#20999;&#25442;
</span>(<span style="color: #00ffff; font-weight: bold;">require</span> '<span style="color: #b0c4de; font-weight: bold;">tabbar</span>)
(tabbar-mode)
(global-set-key (kbd <span style="color: #f0e68c;">"&lt;s-left&gt;"</span>) 'tabbar-backward-group)
(global-set-key (kbd <span style="color: #f0e68c;">"&lt;s-right&gt;"</span>) 'tabbar-forward-group)
(global-set-key (kbd <span style="color: #f0e68c;">"&lt;s-up&gt;"</span>) 'tabbar-backward)
(global-set-key (kbd <span style="color: #f0e68c;">"&lt;s-down&gt;"</span>) 'tabbar-forward)

<span style="color: #ffd700;">;;</span><span style="color: #ffd700;">git
</span>(add-to-list 'load-path <span style="color: #f0e68c;">"~/.emacs.d/git-emacs"</span>)
(<span style="color: #00ffff; font-weight: bold;">require</span> '<span style="color: #b0c4de; font-weight: bold;">git-emacs</span>)
<span style="color: #ffd700;">;;</span><span style="color: #ffd700;">(add-to-list 'load-path "~/.emacs.d/git-emacs")
</span>(fmakunbound 'git-status)
(<span style="color: #00ffff; font-weight: bold;">require</span> '<span style="color: #b0c4de; font-weight: bold;">git-emacs-autoloads</span>)
</pre>




</div>
</div>

</div>

<div id="outline-container-2" class="outline-2">
<h2 id="sec-2">2 常用功能 </h2>
<div id="text-2">


</div>

</div>

<div id="outline-container-3" class="outline-2">
<h2 id="sec-3">3 常用插件 </h2>
<div id="text-3">

</div>
</div>
<div id="postamble"><p class="author"> Author: Wang Wanqing
<a href="mailto:wwq0327@gmail.com">&lt;wwq0327@gmail.com&gt;</a>
</p>
<p class="date"> Date: <2011-01-07></p>
<p>HTML generated by org-mode 6.21b in emacs 23</p>
</div></body>
</html>
